<?php

//Load Master Page
require_once('../shared/layout.php');

class Index extends Layout {

    protected $lstContentPageType;

    
    protected function Form_Create() {
        parent::Form_Create();

        $this->strContextMenu = __DOCROOT__ . __SUBDIRECTORY__ . '/admin/view/content_page/menu/index.tpl.php';
        
        $this->CssClass = 'form-horizontal';

        $this->lstContentPageType = new QListBox($this);
        $this->lstContentPageType->Name = QApplication::Translate('Content Page');
        $this->lstContentPageType->AddAction(new QChangeEvent(), new QJavaScriptAction('Index.ReloadIframe(this)'));
        
        $objContentKeyArray = ContentKey::LoadAll(
                QQ::Clause(
                        QQ::GroupBy(QQN::ContentKey()->ContentPageTypeId),
                        QQ::Select(QQN::ContentKey()->ContentPageTypeId)
                ));
        
        $this->lstContentPageType->AddItem(QApplication::Translate('- Select Page -'), null, true);
        foreach ($objContentKeyArray as $objContentKey) {
            $this->lstContentPageType->AddItem(ContentPageType::ToString($objContentKey->ContentPageTypeId));
        }
        
        $this->lstContentPageType->AddJavascriptFile('../../../admin/content/js/content_page/index.js');
    }
}

Index::Run('Index', __DOCROOT__ . __SUBDIRECTORY__ . '/admin/view/content_page/index.tpl.php');
?>